package com.example.yqand4v1_1.beans;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    private Integer code;
    private String token;
    private T data;

    public static <T> Result<T> success(){
        return new Result<>(666,"success",null);
    }
    public static <T> Result<T> success(T data){
        return new Result<>(666,"success",data);
    }
    public static <T> Result<T> success(T data,String msg){
        return new Result<>(666,msg,data);
    }
    public static <T> Result<T> success(String msg){
        return new Result<>(666,msg,null);
    }
    public static <T> Result<T> fail(Integer code,String msg){
        return new Result<>(code,msg,null);
    }

}
